<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>

<body>
<div id="app">
    {{msg}}
    <input type="text" v-model="msg" v-on:keyup="change">
</div>
</body>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            // msg: "hello vue",
            msg:""
        },
        mounted() {
          this.msg=localStorage.getItem("msg")
        },
        methods: {
            change:function () {
                localStorage.setItem("msg",this.msg)
            }
        },
    })

</script>

</html>